import Vue from 'vue'
import VueRouter from 'vue-router'

//懒加载

//首页
const Home = () => import('../views/Home.vue')

//产品
const Product = () => import('../views/Product.vue')

//我的
const Personal = () => import('../views/Personal.vue')

//登陆页
const Login = () => import('../views/Login.vue')

//设置页面
const SetUp = () => import('../views/SetUp.vue')

//充值
const Recharge = () => import('../views/Recharge.vue')

//提现
const Withdrawal = () => import('../views/Withdrawal.vue')

//提现列表
const WithdrawalList = () => import('../views/WithdrawalList.vue')

//实名认证
const Authentication = () => import('../views/Authentication.vue')

//客服
const KeFu = () => import('../views/Kefu.vue')

//系统公告
const AnnouncementList = () => import('../views/AnnouncementList.vue')

//公告详情
const MessageContent = () => import('../views/MessageContent.vue')

//划转
const Transfer = () => import('../views/Transfer.vue')

//邀请好友
const InviteFriends = () => import('../views/InviteFriends.vue')

//我的团队
const MyTeam = () => import('../views/MyTeam.vue')

//团队设置
const TeamSet = () => import('../views/TeamSet.vue')

//团队明细
const TeamInfo = () => import('../views/TeamInfo.vue')

//404路由错误时跳转
const Page404 = () => import('../views/Page404.vue')

Vue.use(VueRouter)

const routes = [
	//设置默认路径
	{
		path: '/',
		redirect: 'Login'
	},
	{
		path: '/Login',
		name: 'Login',
		component: Login
		// component: () => import('../views/Login.vue')
	},
	{
		path: '/Home',
		name: 'Home',
		component: Home
	},
	{
		path: '/Product',
		name: 'Product',
		component: Product
	},
	{
		path: '/Personal',
		name: 'Personal',
		component: Personal
	},
	{
		path: '/SetUp',
		name: 'SetUp',
		component: SetUp
	},
	{
		path: '/Withdrawal',
		name: 'Withdrawal',
		component: Withdrawal
	},
	{
		path: '/WithdrawalList',
		name: 'WithdrawalList',
		component: WithdrawalList
	},
	{
		path: '/Authentication',
		name: 'Authentication',
		component: Authentication
	},
	{
		path: '/KeFu',
		name: 'KeFu',
		component: KeFu
	},
	{
		path: '/AnnouncementList',
		name: 'AnnouncementList',
		component: AnnouncementList
	},
	{
		path: '/MessageContent',
		name: 'MessageContent',
		component: MessageContent
	},
	{
		path: '/Transfer',
		name: 'Transfer',
		component: Transfer
	},
	{
		path: '/InviteFriends',
		name: 'InviteFriends',
		component: InviteFriends
	},
	{
		path: '/MyTeam',
		name: 'MyTeam',
		component: MyTeam
	},
	{
		path: '/Recharge',
		name: 'Recharge',
		component: Recharge
	},
	{
		path: '/TeamSet',
		name: 'TeamSet',
		component: TeamSet
	},
	{
		path: '/TeamInfo',
		name: 'TeamInfo',
		component: TeamInfo
	},
	{ // 当没有匹配到正确路由的时候，匹配notOpen组件
		path: '*',
		component: Page404,
		meta: {
			footShow: false // true显示，false隐藏
		}
	}

]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
